<template>
  <a-card class="info" title="应聘登记表">
      <!-- <template slot="extra">
        <a-button
            class="ruleButton"
            :ghost="true"
            type="primary"
            icon="edit"
            @click="handleEdit(model)"
            :disabled="isDisabledAuth('erpHrApplyRegisterBill:edit')"
        />
      </template> -->
     <a-row type="flex"  justify="center" v-if="model">
       <a-col :span="24">
          <erp-hr-apply-register-bill-form ref="realForm" :disabled="true" normal></erp-hr-apply-register-bill-form>
       </a-col>
       <a-col :span="24">
          <erp-hr-apply-result-info-form ref="resultForm" :disabled="true" normal></erp-hr-apply-result-info-form>
       </a-col>
     </a-row>
     <div v-else>暂无应聘信息</div>
     <!-- <erp-hr-apply-register-bill-modal ref="modalForm" @ok="modalFormOk"></erp-hr-apply-register-bill-modal> -->
  </a-card>
</template>

<script>

  import { getAction } from '@/api/manage'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import ErpHrApplyRegisterBillForm from '@views/erp/hr/apply/modules/ErpHrApplyRegisterBillForm'
  // import ErpHrApplyRegisterBillModal from '@views/erp/hr/apply/modules/ErpHrApplyRegisterBillModal'
  // import ErpHrApplyQualificationsInfoList from '@views/erp/hr/apply/ErpHrApplyQualificationsInfoList.vue'
  // import ErpHrApplyContactInfoList from '@views/erp/hr/apply/ErpHrApplyContactInfoList.vue'
  // import ErpHrApplyFamilySocialInfoList from '@views/erp/hr/apply/ErpHrApplyFamilySocialInfoList.vue'
  // import ErpHrApplyWorkHistoryList from '@views/erp/hr/apply/ErpHrApplyWorkHistoryList.vue'
  // import ErpHrApplyEducationList from '@views/erp/hr/apply/ErpHrApplyEducationList.vue'
  // import ErpHrApplyTrainingList from '@views/erp/hr/apply/ErpHrApplyTrainingList.vue'
  // import ErpHrApplyRewardPunishFileList from '@views/erp/hr/apply/ErpHrApplyRewardPunishFileList.vue'
  // import ErpHrApplyOtherInfoList from '@views/erp/hr/apply/ErpHrApplyOtherInfoList.vue'
  import {DisabledAuthFilterMixin} from '@/mixins/DisabledAuthFilterMixin'
  import ErpHrApplyResultInfoForm from '@views/erp/hr/apply/modules/ErpHrApplyResultInfoForm'

  export default {
    name: 'ErpHrApplyRegisterBillDetail',
    mixins: [JeecgListMixin, DisabledAuthFilterMixin],
    components: {
      ErpHrApplyResultInfoForm,
      ErpHrApplyRegisterBillForm,
    //  ErpHrApplyRegisterBillModal,
    //   ErpHrApplyQualificationsInfoList,
    //   ErpHrApplyContactInfoList,
    //   ErpHrApplyFamilySocialInfoList,
    //   ErpHrApplyWorkHistoryList,
    //   ErpHrApplyEducationList,
    //   ErpHrApplyTrainingList,
    //   ErpHrApplyRewardPunishFileList,
    //   ErpHrApplyOtherInfoList,
    },
    data () {
      return {
        model: {},
        id: '',
        url: {
          queryById: "/api/erp/hr/apply/erpHrApplyRegisterBill/queryById",
          delete: "/api/erp/hr/apply/erpHrApplyRegisterBill/delete",
          queryByBillId:"/api/erp/hr/apply/erpHrApplyResultInfo/queryByBillId"
        },
        confirmLoading: false,
        iconStyle:{"font-size":"20px"},
        disableMixinCreated: true
      }
    },
    props: {
      applyId: String
    },
    watch: {
      applyId: {
        handler: function(val){
          this.getData(val)
          // if(!val){
          //   this.model = null
          // } else {
          //   this.getData(val)
          // }
        },
        immediate: true
      },
      // BUG4233 查看多人员工档案信息，信息数据被覆盖
      $route(to, from) {
        this.getData(to.query.applyId)
      },
    },
    methods: {
      getData(id) {
        getAction(this.url.queryById, { id }).then((res) => {
          if (res.success) {
            this.model = res.result
            this.$refs.realForm.model = res.result
            this.$refs.realForm.checked = true
            this.$refs.resultForm.model = res.result.applyResultInfo;
            this.$refs.resultForm.step = '4';
          } else {
            this.model = null
          }
        })
      },
    }
  }
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';

.info {
  /deep/ .ant-card-head-title{
    flex: none;
    margin-right: 20px;
  }
  /deep/ .ant-card-extra{
    flex: 1;
    float: left;
  }
}
</style>
